from appium.webdriver.common.appiumby import AppiumBy

from config.weixin_desiredCaps import weixin_appium_desired


def login(username,password):
    weixin_driver=weixin_appium_desired()
    # 登录
    weixin_driver.find_element(AppiumBy.XPATH,'//android.widget.Button[@text="登录"]').click()
#     输入手机号
    weixin_driver.find_element(AppiumBy.XPATH,'//android.widget.EditText[@text="请填写手机号"]').send_keys("18326923357")
#     点击“同意并继续”android.widget.Button
    weixin_driver.find_element(AppiumBy.XPATH,'//android.widget.Button[@text="同意并继续"]').click()
#     请填写微信密码
    weixin_driver.find_element(AppiumBy.XPATH,'//android.widget.EditTex[@text="请输入密码"]').send_keys("kdd485720")
#     点击登录
    weixin_driver.find_element(AppiumBy.XPATH,'//android.widget.Button[@text="登录"]').click()
#


